home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / t / tar / Tar`Doc < prev   
Text File  |  1993-08-26  |  16KB  |  435 lines

  1.  
  2. tar - tape archive, version 1.1o, written for the Archimedes by
  3.  
  4.                     Frank Lancaster, 7-Nov-1991
  5.  
  6.  
  7. Bug reports and comments may be sent as e-mail to: fl@tools.uucp
  8. Paper Mail: Frank Lancaster
  9.             Tools GmbH
  10.             Kessenicher Str. 108
  11.             W-5300 Bonn 1
  12.             Federal Republic of Germany
  13.  
  14.  
  15. This programme is public domain. You may copy it freely, provided
  16. you do not charge ANYTHING for its distribution.
  17.  
  18.  
  19. Table of Contents
  20. -----------------
  21.  1. Introduction
  22.  2. Installation
  23.  3. Usage
  24.  4. Normal Files As Archives
  25.  5. Hard Disc Backup
  26.  6. Compression
  27.  7. The List File
  28.  8. UNIX Compatibility
  29.  9. Raw disc dumping
  30. 10. History
  31.  
  32.  
  33. 1. Introduction
  34. ---------------
  35. This version of tar is derived from the UNIX tar utility. Its main use
  36. is as a hard disk backup programme. It also comes in very handy when
  37. transferring files from or to UNIX. The name "tape archive" is misleading but
  38. historical. On the Archimedes archives are ordinary files on any
  39. file-system (adfs, scsi, dosfs, etc.). Multiple disc archives are supported,
  40. now also as ordinary files. Disk archives in ADFS D/E/L or MS-DOS (double-
  41. sided, 9 sectors) format dumped to raw disks are supported.
  42.  
  43.  
  44. 2. Installation
  45. ---------------
  46. If you have clib version 3.66, you can use the tar_clib and compr_clib
  47. versions of tar and compress.
  48. Before using the programme set the system variable "tar$scrap" to the
  49. name of a temporary scrap file which should only be used by tar,
  50. for example "adfs::4.$.tmp.scrap". The leaf name must not be longer than
  51. 8 characters, another 2 ("-Z") are added if compression is used.
  52. This file will only be used if compression is enabled.
  53. If compression is used tar requires the compress programme (included in
  54. this distribution), which handles compression and decompression. Normally
  55. this should be accessable via the system variable Run$Path, but you can
  56. customize the compression and decompression commands with the two system
  57. variables tar$compress and tar$decompress (see below "compression").
  58. The system variable tar$filetype is used as file type for tar files. If
  59. it is not set, file type FFD (data) is used.
  60.  
  61.  
  62. 3. Usage
  63. --------
  64. The programme should be called from the command line interpreter as it
  65. requires parameters.
  66.  
  67. tar [-]Commands[Options] ARCHIVE [LIST] [BLKS] [LEN] [-C DIR] file1 file2 ...
  68.  
  69. Commands:
  70.      c           create a new archive
  71.      r           append files to end of archive
  72.      t           list the contents of an archive
  73.      x           extract files from an archive
  74.  
  75. Options:
  76.      b BLKS      blocking factor BLKS (block size = BLKS x 512 bytes)
  77.      e LENGTH    maximum length of extension to use in UNIX file names
  78.      f ARCHIVE   read/write archive from file ARCHIVE (mandatory)
  79.      i           ignore checksum errors and blocks of zeros (normally EOF)
  80.      l [LIST]    read list of files from file LIST or !tarlist as default
  81.      m           don't extract file modified time
  82.      p           convert '!' in RISC OS names to '.' in UNIX names
  83.      s           swap extension in filename
  84.      v           verbosely list what files we process
  85.      w           ask for confirmation
  86.      z           run files through compress
  87.      B           reblock as we read
  88.      C DIR       change to directory DIR
  89.      E           '.' in UNIX names will be converted to '_'
  90.      F           format disk in drive 0 (multiple volumes & E-format only)
  91.      M           use multiple volume archiving
  92.      O           do not prompt for confimation when formating or overwriting disks
  93.      Q           quit immediately if error occurs, do not prompt for action
  94.      S           swap extensions in whole path
  95.      T           file types appended to names as with RISC-OS NFS
  96.      U           UNIX archive (no Archimedes extensions)
  97.      Z           convert UNIX '.Z' to '-Z' when extracting
  98.  
  99.  
  100. You must specify an archive file on the command line with the 'f' option.
  101. The path names of the archived files are stored as specified on
  102. the command line. Using the 'v' (verbose) option will list the path names
  103. stored as the archive is created. Normally you shouldn't specify the absolute
  104. path names, as you may want to extract the files to an other directory.
  105.  
  106.  
  107. 4. Normal Files As Archives
  108. ---------------------------
  109. Here the use of tar is identical to the UNIX usage. The file name of an
  110. archive must always be supplied with the 'f' option. To create an archive
  111. use the 'c' option:
  112.  
  113. tar cvf myarc file1 file2 file3
  114.  
  115. This will create an archive 'myarc' in the current directory which contains
  116. the files 'file1', 'file2' and 'file3'. I always recommend using the 'v'
  117. option with every command, this gives more information on what is happening.
  118.  
  119. You can use path names with the archives and files specified:
  120.  
  121. tar cvf adfs::4.tmp.myarc adfs::5.file1 adfs::4.src.file2
  122.  
  123. To list the contents of an archive use the 't' command:
  124.  
  125. tar tvf myarc
  126.  
  127. To extract files from an archive use the 'x' command:
  128.  
  129. tar xvf myarc
  130.  
  131. This command will extract all files in the archive. If you only want certain
  132. files, you can specify them after the archive name:
  133.  
  134. tar xvf myarc file1 file2
  135.  
  136.  
  137. 5. Hard disc backup
  138. -------------------
  139. This actually isn't very different from normal archiving. The main difference
  140. is that archive files are of course written to floppy discs and that they
  141. can be split across several discs. The command:
  142.  
  143. tar cvMf :0.backup :4.*
  144.  
  145. will backup all files on the hard disk :4 onto floppy disk :0 in the
  146. file 'backup'. If the archive requires more than one floppy disc, you will
  147. be prompted for more discs, which will contain further files also called
  148. 'backup'. They contain a header which supplies identification of the disc
  149. number so that 'tar' will be able to determine the disc sequence when
  150. extracting.
  151.  
  152. It would be better to go to the root directory of the hard disc and to use
  153. the following command:
  154.  
  155. tar cvMf :0.backup *
  156.  
  157. This will store the path names without the drive name, so you could extract
  158. them onto a different hard disk.
  159.  
  160. The command:
  161.  
  162. tar tvf :0.backup
  163.  
  164. will list the contents of an archive on floppy disc :0. If the archive was
  165. split across several discs, tar will prompt for further discs when finished
  166. listing one.
  167.  
  168. The command:
  169.  
  170. tar xvf :0.backup
  171.  
  172. will extract all files on floppy disc :0 in the file 'backup'. If the file,
  173. which is being extracted, already exists, tar will overwrite it without any
  174. warning.
  175.  
  176.  
  177. 6. Compression
  178. --------------
  179. With the 'z' option files can be compressed before being written to an archive.
  180. For compression the standard UNIX utility compress is used, also supplied with
  181. the tar programme. The system variable tar$scrap is used for temporary storage.
  182. If you are backing up a complete hard disc and have enough memory you should
  183. use a RAM disc for the scrap file, and the compress programme should also be
  184. copied onto the RAM disc. You can use different programmes for
  185. compression and decompression if you set the tar$compress and tar$decompress
  186. system variables. The default settings are:
  187.  
  188.   tar$compress          compress < %1 > %2
  189.   tar$decompress        compress -d < %1 > %2
  190.  
  191. Most compression programmes add a suffix to the compressed file. The UNIX
  192. compress programme adds '-Z'. If a compression programme that you want to use,
  193. uses a different suffix, you can set the system variable 'tar$compress$extension'.
  194.  
  195. When writing a file 'TresImp' to an archive the compress command will expand to:
  196.  
  197.   compress < TresImp > Scrap-Z
  198.  
  199. The %1 parameter is substituted with the file name and %2 is substituted with
  200. the scrap file name.
  201.  
  202. The decompress command, when extracting the file, will expand to:
  203.  
  204.   compress -d < Scrap-Z > TresImp
  205.  
  206. So if you have a compression programme 'squash' and a decompression programme
  207. 'expand', which take two parameters and don't use I/O redirection, set the
  208. variables to:
  209.  
  210.   tar$compress          squash %1 %2
  211.   tar$decompress        expand %1 %2
  212.  
  213. You can also specify absolute paths in these variables, e.g. when the
  214. compression programme is on the RAM disc:
  215.  
  216.   tar$compress          ram:$.compress < %1 > %2
  217.   tar$decompress        ram:$.compress -d < %1 > %2
  218.  
  219. Compressed files are automatically detected when extracting. A verbose listing
  220. of the archive also shows the comp